<script type="text/javascript" src="/assets/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/assets/js/jquery-ui.js"></script>
<script type="text/javascript" src="/assets/js/jquery-ui-timepicker-addon.js"></script>
<link href="/assets/css/jquery-ui.css" rel="stylesheet">
<link href="/assets/css/jquery-ui-timepicker-addon.css" rel="stylesheet">

<table style="width: 80%;" align="center">
    <tr>
        <td>
            <div class="well">

                <div class="titulos"><?=  strtoupper($segmento).' / '.$idiomat?></div><br>
                <div class="textos">
                    Choose Language: 
                    <select name="idioma" onchange="change(this)">
                        <option value="">Choose...</option>
                        <option value="ar">Arabic</option>
                        <option value="en">English</option>
                        <option value="es">Spanish</option>
                        <option value="pt">Portuguese</option>
                    </select>

                    <script type="text/javascript">
                        function change(sel) {
                            window.location.href='/panel/<?=$segmento?>/'+sel.options[sel.selectedIndex].value+'/';
                        }
                    </script>    

                    <form method="post">
                        Date/Time: <input name="fecha" type="text" class="input-block-level" id="fecha">
                        <br>
                        Description: <input type="text" name="descripcion">
                        <br>
                        <input type="submit" value="ADD">
                    </form>
                
                    <br>
                <table border="1">
                    <thead>
                        <tr>
                            <th>Fecha</th>
                            <th>Descripcion</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($events as $event) { ?>
                        <tr>
                            <td><?=$event['fecha']?></td>
                            <td><?=$event['descripcion']?></td>
                            <td><a href="/panel/delete/<?=$segmento?>/<?=$idioma?>/<?=$event['idevents']?>/">Delete</a></td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
            </div>
            </div>
        </td>
    </tr>
</table>

<script type="text/javascript">
    $(document).ready(function() {
        $("#fecha").datetimepicker({
            timeFormat: 'HH:mm:00'
        });
    });
</script>